import axios from './interceptor'
// 获取前台首页数据
function getFrontData() {
  return axios.get('/endIndex/front')
}

// 修改前端首页数据
function updateEndIndexData(
  typewriter: string,
  bulletin: string,
  footer: string
) {
  return axios.post('/endIndex', {
    typewriter,
    bulletin,
    footer,
  })
}
// 获取前端个人页面数据
function getFrontCenter() {
  return axios.get('/endIndex/center')
}

// 修改个人页面数据
function updateFrontCenter(
  tel: string,
  wechat: string,
  qq: string,
  motto: string,
  uname: string,
  location: string
) {
  return axios.post('/endIndex/center', {
    token: localStorage.getItem('token'),
    tel,
    wechat,
    qq,
    motto,
    uname,
    location,
  })
}
// 获取后端首页数据
const getEndData = () => {
  return axios.get('/endIndex')
}
export {
  getFrontData,
  updateEndIndexData,
  getFrontCenter,
  updateFrontCenter,
  getEndData,
}
